import * as types from "./types";
import axios from "axios";
export const incrementAction = (value = 1) => {
  return {
    type: types.INCREMENT,
    value,
  };
};

export const decrementAction = (value = 1) => {
  return {
    type: types.DECREMENT,
    value,
  };
};

export const getTodos = function () {
  return function (dispatch) {
    axios.get("http://jsonplaceholder.typicode.com/todos").then((res) => {
      dispatch({
        type: "GET_TODOS",
        value: res.data,
      });
    });
  };
};

// 柯里化
